home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / CTBUtilities.h < prev    next >
Text File  |  1991-04-17  |  4KB  |  158 lines

  1. /*
  2.     File:        CTBUtilities.h
  3.  
  4.     Copyright:    © 1990 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7. */
  8.  
  9. #ifndef __CTBUTILITIES__
  10. #define __CTBUTILITIES__
  11.  
  12. #ifndef    __MEMORY__
  13. #include    <Memory.h>
  14. #endif
  15.  
  16. #ifndef __PACKAGES__
  17. #include    <Packages.h>
  18. #endif
  19.  
  20. #ifndef __APPLETALK__
  21. #include <AppleTalk.h>
  22. #endif
  23.  
  24. /*    version of Comm Toolbox Utilities    */
  25. #define    curCTBUVersion            2
  26.  
  27. /*    Error codes/types    */
  28. typedef        OSErr    CTBUErr;
  29.  
  30. #define        ctbuGenericError    (-1)
  31. #define        ctbuNoErr            0
  32.  
  33. /*    Dialog Item List Manipulation Constants    */
  34. typedef short DITLMethod;
  35. enum {
  36.     overlayDITL,
  37.     appendDITLRight,
  38.     appendDITLBottom
  39. };
  40.  
  41. /*    Choose return codes    */
  42. enum {
  43.     chooseDisaster = -2,
  44.     chooseFailed,
  45.     chooseAborted,
  46.     chooseOKMinor,
  47.     chooseOKMajor,
  48.     chooseCancel
  49. };
  50.  
  51. /*    NuLookup return codes    */
  52. enum {
  53.     nlOk,
  54.     nlCancel,
  55.     nlEject
  56. };
  57.     
  58. /*    Name filter proc return codes    */
  59. enum {
  60.     nameInclude = 1,
  61.     nameDisable,
  62.     nameReject
  63. };
  64.     
  65. /*    Zone filter proc return codes    */
  66. enum {
  67.     zoneInclude = 1,
  68.     zoneDisable,
  69.     zoneReject
  70. };
  71.     
  72. /*    Values for hookProc items        */
  73. #define        hookOK                1
  74. #define        hookCancel             2
  75. #define        hookOutline            3
  76. #define        hookTitle            4
  77. #define        hookItemList        5
  78. #define        hookZoneTitle        6
  79. #define        hookZoneList        7
  80. #define        hookLine            8
  81. #define        hookVersion            9
  82. #define        hookReserved1        10
  83. #define        hookReserved2         11
  84. #define        hookReserved3        12
  85. #define        hookReserved4        13
  86. /*    "virtual" hookProc items    */
  87. #define        hookNull            100
  88. #define        hookItemRefresh        101
  89. #define        hookZoneRefresh        102
  90. #define        hookEject            103
  91. #define        hookPreflight        104
  92. #define        hookPostflight        105
  93. #define        hookKeyBase            1000
  94.  
  95.  
  96. /*    NuLookup structures/constants    */
  97. struct NLTypeEntry {
  98.     Handle hIcon;
  99.     Str32 typeStr;
  100. };
  101.  
  102. typedef struct NLTypeEntry NLTypeEntry;
  103.  
  104. typedef NLTypeEntry NLType[4];
  105.  
  106. struct NBPReply {
  107.     EntityName    theEntity;
  108.     AddrBlock    theAddr;
  109. };
  110.  
  111. typedef struct NBPReply NBPReply;
  112.  
  113. typedef pascal short (*NameFilterProcPtr)(EntityName theEntity);
  114. typedef pascal short (*ZoneFilterProcPtr)(Str32 theZone);
  115.  
  116. typedef NameFilterProcPtr nameFilterProcPtr;
  117. typedef ZoneFilterProcPtr zoneFilterProcPtr;
  118.  
  119. #ifdef __cplusplus
  120. extern "C" {
  121. #endif
  122. pascal CTBUErr    InitCTBUtilities(void);
  123. pascal short     CTBGetCTBVersion(void);
  124.  
  125. pascal void        AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method);
  126. pascal short        CountDITL(DialogPtr theDialog);
  127. pascal void        ShortenDITL(DialogPtr theDialog, short numberItems);
  128.  
  129. pascal short     NuLookup(Point where, ConstStr255Param prompt, short numTypes, 
  130.                               NLType typeList, NameFilterProcPtr nameFilter, 
  131.                               ZoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc,
  132.                               NBPReply *theReply);
  133.  
  134. pascal short     NuPLookup(Point where, ConstStr255Param prompt, short numTypes, 
  135.                               NLType typeList, NameFilterProcPtr nameFilter, 
  136.                               ZoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc, 
  137.                               long userData, short dialogID,
  138.                               ModalFilterProcPtr filterProc, 
  139.                               NBPReply *theReply);
  140.                               
  141. pascal short     StandardNBP(Point where, ConstStr255Param prompt, short numTypes, 
  142.                               NLType typeList, NameFilterProcPtr nameFilter, 
  143.                               ZoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc,
  144.                               NBPReply *theReply);
  145.  
  146. pascal short     CustomNBP(Point where, ConstStr255Param prompt, short numTypes, 
  147.                               NLType typeList, NameFilterProcPtr nameFilter, 
  148.                               ZoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc, 
  149.                               long userData, short dialogID,
  150.                               ModalFilterProcPtr filterProc, 
  151.                               NBPReply *theReply);
  152.                               
  153.                               
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157.  
  158. #endif __CTBUTILITIES__